<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" import="java.util.*"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath() + "/";
	//response.sendRedirect("common/login");
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Article</title>
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.0.3.js"></script>
<script type="text/javascript" src="${path }/resource/layer/layer.js"></script>
<script type="text/javascript" src="${path }/resource/js/mytools.js"></script>
<script type="text/javascript"
	src="${path }/resource/editor/kindeditor.js"></script>
	<script type="text/javascript"
	src="${path }/resource/editor/kindeditor-min.js"></script>
	<script type="text/javascript"
	src="${path }/resource/editor/kindeditor-all-min.js"></script>
<script type="text/javascript"
	src="${path }/resource/editor/lang/zh-CN.js"></script>
<script type="text/javascript"
	src="${path }/resource/editor/plugins/code/prettify.js"></script>
<link rel="stylesheet"
	href="${path }/resource/editor/plugins/code/prettify.css" />
<link rel="stylesheet"
	href="${path }/resource/editor/themes/default/default.css" />
<link rel="stylesheet"
	href="${path }/resource/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="${path }/resource/bootstrap/css/bootstrap-responsive.min.css" />
</head>
<body>
	<div class="container">
		<form class="form-horizontal" onsubmit="return save();" action="${path }/user/home/Article/addOrModify"
			id="from1" name="example" method="post">
			<input type="hidden" name="id" value="${obj.id}" />
			<!--隐藏域id el表达式获取 -->
			<div class="form-group">
				<label class="col-sm-2 control-label">articleName:</label>
				<div class="col-sm-4">
					<input type="text" name="articleName" class="form-control"
						value="${obj.articleName}" id="articleName" />
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">content:</label>
				<div class="col-sm-4">
					<textarea rows="" cols="" id="kid" name="content"
						style="width: 420px; height: 300px;">${obj.content}</textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">quantity:</label>
				<div class="col-sm-4">
					<input type="text" name="quantity" class="form-control"
						value="${obj.quantity}" id="quantity" />
				</div>
			</div>
			<div class="control-group text-center">
				<div class="controls">
					<input type="submit" value="保存" class="btn btn-default btn-sm"
						> <input type="reset"
						class="btn btn-default btn-sm" value="重置">
				</div>
			</div>
		</form>
	</div>
	<script type="text/javascript">
		var editor1 ;
		function save() {
			editor1.sync();
			form.submit();
			parent.mjs.search();
			parent.layer.closeAll();
			//return true;
		}
		KindEditor.ready(function(K) {
			editor1 = K.create('#kid', {
				cssPath : '${path }/resource/editor/plugins/code/prettify.css',
				uploadJson :'${path}/resource/editor/jsp/upload_json.jsp',
				fileManagerJson : '${path}/resource/editor/jsp/file_manager_json.jsp',
				//uploadJson : '动态上传处理程序文件',
				//fileManagerJson : '已上传文件管理程序文件',
				allowFileManager : true,
				urlType : 'absolute',
				/* afterBlur : function() {
					
					K.ctrl(document, 13, function() {
						save();
						alert("保存成功");
					});
					K.ctrl(this.edit.doc, 13, function() {
						save();
						alert("保存成功");
					});
				} */
			});
			prettyPrint();
		});
	</script>
</body>
</html>
